//
//  YDPositionTableFooterView.m
//  PeiZiWangBei
//
//  Created by LK-IOS on 2017/11/9.
//  Copyright © 2017年 LK-IOS. All rights reserved.
//

#import "YDPositionTableFooterView.h"


@interface YDPositionTableFooterView()

//盈利亏损label
@property (nonatomic , weak) UILabel *lossLabel;

@end



@implementation YDPositionTableFooterView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = NumberColor(247, 247, 247);
        [self lossLabel];
    }
    return self;
}

-(UILabel *)lossLabel
{
    if (_lossLabel == nil) {
        UILabel *lossLabel = [[UILabel alloc] init];
        [self addSubview:lossLabel];
        lossLabel.textColor = [UIColor colorWithHexString:blueyGrey];
        lossLabel.font = [UIFont systemFontOfSize:font14ScreenWRate * LKScreenW];
        lossLabel.textAlignment = NSTextAlignmentRight;
//        lossLabel.text = @"持仓盈利总计：+2元";
        [lossLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(self);
        }];
        NSString *str1 = @"+2";
        NSString *str2 = @"持仓盈利总计：+2元";
        lossLabel.attributedText = [NSString getAttriNeedChangeString:str1 changeColor:[UIColor colorWithHexString:paleRed] changeFont:[UIFont systemFontOfSize:font14ScreenWRate * LKScreenW] sourceString:str2];
        _lossLabel = lossLabel;
    }
    return _lossLabel;
}

@end
